﻿<ResourceDictionary
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  xmlns:tkt="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
  xmlns:ctls="clr-namespace:uhul.Controls"
  xmlns:app="clr-namespace:uhul"
  xmlns:System="clr-namespace:System;assembly=mscorlib"
  mc:Ignorable="d"
>

  <!--
  sablona pro vizitku aplikace
  -->
  <Style TargetType="ctls:AppVCard">
    <Setter Property="Width" Value="300"/>
    <Setter Property="Height" Value="150"/>
    <Setter Property="Background" Value="#FF81E46D"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="ctls:AppVCard">

          <Grid Width="{TemplateBinding Width}" Height="{TemplateBinding Height}">

            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">

                <VisualState x:Name="Normal"/>

                <VisualState x:Name="MouseOver">
                  <Storyboard>
                    <DoubleAnimation 
                      Duration="0:0:0.1" To="1"
                      Storyboard.TargetProperty="(UIElement.Opacity)"
                      Storyboard.TargetName="okrajVizitky" d:IsOptimized="True"
										/>
                    <DoubleAnimation 
                      Duration="0:0:0.1" To="1"
                      Storyboard.TargetProperty="(UIElement.Opacity)"
                      Storyboard.TargetName="AppVCardThemeColor" d:IsOptimized="True"
										/>
                    <DoubleAnimation 
                      Duration="0:0:0.1" To="1"
                      Storyboard.TargetProperty="(UIElement.Opacity)"
                      Storyboard.TargetName="AppVCardProviderIcon" d:IsOptimized="True"
										/>
                  </Storyboard>
                </VisualState>

                <VisualState x:Name="Pressed"/>

                <VisualState x:Name="Disabled"/>

              </VisualStateGroup>

              <VisualStateGroup x:Name="FocusStates">
                <VisualState x:Name="Focused"/>
                <VisualState x:Name="Unfocused"/>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>

            <Grid
							x:Name="okrajVizitky"
              Margin="5"
							Opacity="0.85"
            >
              <Grid Margin="0" x:Name="AppVCardThemeColor" Background="{TemplateBinding Background}" Opacity=".6"/>

              <Grid>
              	<Grid.Clip>
					        <RectangleGeometry Rect="0,0,290,140"/>
						    </Grid.Clip>

                <Image
									x:Name="AppVCardIcon"
									HorizontalAlignment="Left"
									Width="145"
									Stretch="UniformToFill"
                />
								
                <!--Source="{TemplateBinding AppIcon}"
                {TemplateBinding AppInfo.Name}-->

								<Border
									Width="200" Margin="-60,5,5,-50"
									Height="Auto"
									HorizontalAlignment="Left" 
								>
									<Border.Background>
										<RadialGradientBrush x:Name="IconLabelShadowColor" >
                      <GradientStop Color="White" Offset="0"/>
											<GradientStop Offset="0.991" Color="Transparent"/>
										</RadialGradientBrush>
									</Border.Background>
									<Border.OpacityMask>
										<RadialGradientBrush>
											<GradientStop Color="#90000000" Offset="0.845"/>
											<GradientStop Color="#ff000000" Offset="1"/>
										</RadialGradientBrush>
									</Border.OpacityMask>
								</Border>
								<TextBlock
	                  x:Name="AppVCardLabel"
										Foreground="White"
	                  FontFamily="Segoe UI Semibold" FontSize="24" TextWrapping="Wrap"
										HorizontalAlignment="Left" VerticalAlignment="Bottom"
										Width="127" Height="Auto"
										Margin="5"
                	/>
                <!--Text="{TemplateBinding AppName}"-->

                <TextBlock
                  x:Name="AppVCardDescription" Margin="0,8,8,8"
                  TextWrapping="Wrap" FontSize="14.667"
                  FontFamily="/XapExplorer;component/Fonts/Fonts.zip#Segoe UI Light"
                  
                  HorizontalAlignment="Right" Width="128"
                />
                <!--Text="{TemplateBinding AppDescription}"-->

                <Image
                  x:Name="AppVCardProviderIcon"
                  HorizontalAlignment="Right"
                  VerticalAlignment="Top"
                  Height="25"
                  Width="150"
                  Stretch="Uniform"
                  Margin="0,0,145,0"
                  Opacity="0"
                />
                <!--Source="{TemplateBinding AppProviderIcon}"-->

              </Grid>

            </Grid>

            <!--<ContentPresenter x:Name="contentPresenter" 
                              ContentTemplate="{TemplateBinding ContentTemplate}" 
                              Content="{TemplateBinding Content}" 
                              Margin="3"
                              Opacity=".6"
                />-->

          </Grid>
        </ControlTemplate>
      </Setter.Value>

    </Setter>
  </Style>





  <Style TargetType="ctls:BusyButton">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="ctls:BusyButton">
          <Grid x:Name="grid" Background="red">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Pressed"/>
                <VisualState x:Name="Normal"/>
                <VisualState x:Name="Disabled"/>
                <VisualState x:Name="MouseOver">
                  <Storyboard>
                    <ColorAnimation 
                      Storyboard.TargetName="grid"
                      Duration="0" To="#FF5C4C4C"
                      Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)"
                      d:IsOptimized="True"
                    />
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="BusyStates">
                <VisualState x:Name="Free"/>
                <VisualState x:Name="Busy">
                  <Storyboard>
                    <ColorAnimation
                      Storyboard.TargetName="grid"
                      Duration="0" To="#FF00FF1B"
                      Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)"
                      d:IsOptimized="True"
                    />
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border
              Background="{TemplateBinding Background}"
              BorderBrush="{TemplateBinding BorderBrush}"
              BorderThickness="{TemplateBinding BorderThickness}"
            />
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>


</ResourceDictionary>
